<script setup>
import { ref, reactive } from 'vue'
import { addShowData } from '../../api/loop'
const form = reactive({
    url: '',
    name: '',
    location: '',
    date: '',
    place: '',
    star: '',
    isshow: ''
})
function addData() {
    addShowData(form)
        .then((res) => {
            console.log(res);
        })
}
</script>
<template>
    <el-form :model="form">
        <el-form-item label="图片地址">
            <el-input v-model="form.url" />
        </el-form-item>
        <el-form-item label="名字">
            <el-input v-model="form.name" />
        </el-form-item>
        <el-form-item label="地点">
            <el-input v-model="form.location" />
        </el-form-item>
        <el-form-item label="时间">
            <el-date-picker v-model="form.date" type="daterange" range-separator="到" start-placeholder="开始时间"
                end-placeholder="结束时间" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :size="size" />
        </el-form-item>
        <el-form-item label="地址">
            <el-input v-model="form.place" />
        </el-form-item>
        <el-form-item label="热度">
            <el-input v-model="form.star" />
        </el-form-item>
        <el-form-item label="是否热卖">
            <el-select v-model="form.isshow" placeholder="请选择是否售卖">
                <el-option label="售卖" value="1" />
                <el-option label="不售卖" value="0" />
            </el-select>
        </el-form-item>
    </el-form>
    <el-button @click="addData()">添加</el-button>
</template>
<style scoped>
img {
    width: 100px;
    height: 100px;
}
</style>